<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<c:set value="${pageContext.request.contextPath}" var="ctx" />
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title></title>
<link href="${ctx}/css/skin.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="${ctx}/js/jquery.js"></script>
<script type="text/javascript">
	function show(index) {
		self.parent.leftFrame.show(index);
		if (index == 1) {
			location.href = "${ctx }/jsp/leaveMgt/leave.jsp";
		} else if (index == 2) {
			location.href = "${ctx }/jsp/daysOffMgt/paidleave.jsp";
		} else if (index == 3) {
			location.href = "${ctx }/jsp/overtimeMgt/overtime.jsp";
		} else if (index == 4) {
			location.href = "${ctx }/jsp/performanceMgt/performance-list.jsp";
		}
	}

	function modifyPassword(op) {
		if (op == 1) {
			//show
			$("#modifyPwd1").val("");
			$("#modifyPwd2").val("");
			$("#divModifyPassword").show();
			$("#modifyPwd1").focus();
		} else {
			//hide
			$("#divModifyPassword").hide();
		}
	}

	function modifyPwdSubmit() {
		var pwd1 = $.trim($("#modifyPwd1").val());
		var pwd2 = $.trim($("#modifyPwd2").val());
		if (pwd1 != "" && pwd2 != "" && pwd1 == pwd2) {
			var obj = {};
			obj.type = "modifypassword";
			obj.password = pwd1;
			$.ajax({
				type : 'post',
				dataType : 'json',
				data : obj,
				url : '${ctx}/user/post',
				success : function(data) {
					if (data.code == "200") {
						alert(data.msg);
					} else {
						alert(data.msg);
					}
					$("#divModifyPassword").hide();
				}
			});
		} else {
			alert("新密码输入有误。");
			$("#modifyPwd1").focus();
		}

	}
</script>
</head>
<body>
	<table width="100%" border="0" cellpadding="0" cellspacing="0">
		<tr>
			<td width="17" height="29" valign="top"
				background="${ctx}/images/mail_leftbg.gif"><img
				src="${ctx}/images/left-top-right.gif" width="17" height="29" /></td>
			<td width="" height="29" valign="top"
				background="${ctx}/images/content-bg.gif"><table width="100%"
					height="31" border="0" cellpadding="0" cellspacing="0"
					class="left_topbg" id="table2">
					<tr>
						<td height="31"><div class="titlebt">首页</div></td>
					</tr>
				</table></td>
			<td width="16" valign="top"
				background="${ctx}/images/mail_rightbg.gif"><img
				src="${ctx}/images/nav-right-bg.gif" width="16" height="29" /></td>
		</tr>
		<tr>
			<td height="71" valign="middle"
				background="${ctx}/images/mail_leftbg.gif">&nbsp;</td>
			<td valign="top" bgcolor="#F7F8F9"><table width="100%"
					height="138" border="0" cellpadding="0" cellspacing="0">
					<tr>
						<td height="13" valign="top">&nbsp;</td>
					</tr>
					<tr>
						<td valign="top"><table width="98%" border="0" align="center"
								cellpadding="0" cellspacing="0">
								<tr>
									<td class="left_txt">当前位置：首页 <a href="javascript:void(0);"
										onclick="modifyPassword(1)" style="float: right">修改密码</a>
									</td>
								</tr>
								<tr>
									<td height="20"><table width="100%" height="1" border="0"
											cellpadding="0" cellspacing="0" bgcolor="#CCCCCC">
											<tr>
												<td></td>
											</tr>
										</table></td>
								</tr>
								<tr>
									<td>&nbsp;</td>
								</tr>
								<tr>
									<td>
										<!-- 
										<div class="divIndexGird" onclick="show(1)">请 假</div>
										<div class="divIndexGird" onclick="show(2)">调 休</div>
										<div class="divIndexGird" onclick="show(3)">加 班</div>
										<div class="divIndexGird" onclick="show(4)">绩效</div>
										 -->
									</td>
								</tr>
							</table></td>
					</tr>
				</table></td>
			<td background="${ctx}/images/mail_rightbg.gif">&nbsp;</td>
		</tr>
		<tr>
			<td valign="middle" background="${ctx}/images/mail_leftbg.gif"><img
				src="${ctx}/images/buttom_left2.gif" width="17" height="17" /></td>
			<td height="17" valign="top"
				background="${ctx}/images/buttom_bgs.gif"><img
				src="${ctx}/images/buttom_bgs.gif" width="17" height="17" /></td>
			<td background="${ctx}/images/mail_rightbg.gif"><img
				src="${ctx}/images/buttom_right2.gif" width="16" height="17" /></td>
		</tr>
	</table>


	<div id="divModifyPassword">
		<br/>
		<table>
			<tr>
				<td>新密码：</td>
				<td><input type="password" id="modifyPwd1" /></td>
			</tr>
			<tr>
				<td>确认新密码：</td>
				<td><input type="password" id="modifyPwd2" /></td>
			</tr>
			<tr>
				<td></td>
				<td><input type="button" onclick="modifyPwdSubmit()"
					value=" 确 定 " /> <input type="button" onclick="modifyPassword(2)"
					value=" 取 消" /></td>
			</tr>
		</table>
	</div>
</body>
</html>